package com.stox.ui.javafx.list.application;

import java.util.Locale;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import com.stox.dto.intf.Application;
import com.stox.ui.javafx.list.view.WatchListView;

@Component
@Lazy(false)
public class WatchListApplication implements Application {

	@Autowired
	private ApplicationContext applicationContext;
	
	@Override
	public String getName() {
		return applicationContext.getMessage("application.name.list", null, Locale.getDefault());
	}

	@Override
	public String getDescription() {
		return applicationContext.getMessage("application.description.list", null, Locale.getDefault());
	}

	@Override
	public String getApplicationClassName() {
		return this.getClass().getCanonicalName();
	}

	@Override
	public String getIconPath() {
		return null;
	}

	@Override
	public String[] getTags() {
		return null;
	}

	@Override
	public void launch(ApplicationContext applicationContext) {
		WatchListView listView = applicationContext.getBean(WatchListView.class);
		listView.open();
	}

}
